//
//  OneBowl.m
//  demo_3
//
//  Created by mac on 12-3-13.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "OneBowl.h"
@implementation OneBowl
-(void)setAttributes:(int)type{
    switch (type) {
        case INDEX_NOODLE:
        {
            typeIndex=INDEX_NOODLE;
            typeReward=REWARD_NOODLE;
            timeRewardPersecond=(int)(REWARD_NOODLE*0.3);
            capacity=20;
            recipe[0]=0;//beef
            recipe[1]=0;//radish
            recipe[2]=20;//flour
            recipe[3]=0;//cucumber
            recipe[4]=0;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_RADISH_NOODLE:
        {
            typeIndex=INDEX_RADISH_NOODLE;
            typeReward=REWARD_RADISH_NOODLE;
            timeRewardPersecond=(int)(REWARD_RADISH_NOODLE*0.3);
            capacity=20;
            recipe[0]=0;//beef
            recipe[1]=5;//radish
            recipe[2]=15;//flour
            recipe[3]=0;//cucumber
            recipe[4]=0;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_CUCUMBER_NOODLE:
        {
            typeIndex=INDEX_CUCUMBER_NOODLE;
            typeReward=REWARD_CUCUMBER_NOODLE;
            timeRewardPersecond=(int)(REWARD_CUCUMBER_NOODLE*0.3);
            capacity=20;
            recipe[0]=0;//beef
            recipe[1]=0;//radish
            recipe[2]=15;//flour
            recipe[3]=5;//cucumber
            recipe[4]=0;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_BEEF_NOODLE:
        {
            typeIndex=INDEX_BEEF_NOODLE;
            typeReward=REWARD_BEEF_NOODLE;
            timeRewardPersecond=(int)(REWARD_BEEF_NOODLE*0.3);
            capacity=20;
            recipe[0]=5;//beef
            recipe[1]=0;//radish
            recipe[2]=15;//flour
            recipe[3]=0;//cucumber
            recipe[4]=0;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_MUTTON_NOODLE:
        {
            typeIndex=INDEX_MUTTON_NOODLE;
            typeReward=REWARD_MUTTON_NOODLE;
            timeRewardPersecond=(int)(REWARD_MUTTON_NOODLE*0.3);
            capacity=20;
            recipe[0]=0;//beef
            recipe[1]=0;//radish
            recipe[2]=15;//flour
            recipe[3]=0;//cucumber
            recipe[4]=5;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_RADISH_BEEF_NOODLE:
        {
            typeIndex=INDEX_RADISH_BEEF_NOODLE;
            typeReward=REWARD_RADISH_BEEF_NOODLE;
            timeRewardPersecond=(int)(REWARD_RADISH_BEEF_NOODLE*0.3);
            capacity=20;
            recipe[0]=5;//beef
            recipe[1]=5;//radish
            recipe[2]=15;//flour
            recipe[3]=0;//cucumber
            recipe[4]=0;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_CUCUMBER_MUTTON_NOODLE:
        {
            typeIndex=INDEX_CUCUMBER_MUTTON_NOODLE;
            typeReward=REWARD_CUCUMBER_MUTTON_NOODLE;
            timeRewardPersecond=(int)(REWARD_CUCUMBER_MUTTON_NOODLE*0.3);
            capacity=20;
            recipe[0]=0;//beef
            recipe[1]=0;//radish
            recipe[2]=15;//flour
            recipe[3]=5;//cucumber
            recipe[4]=5;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_RADISH_MUTTON_NOODLE:
        {
            typeIndex=INDEX_RADISH_MUTTON_NOODLE;
            typeReward=REWARD_RADISH_MUTTON_NOODLE;
            timeRewardPersecond=(int)(REWARD_RADISH_MUTTON_NOODLE*0.3);
            capacity=20;
            recipe[0]=0;//beef
            recipe[1]=5;//radish
            recipe[2]=15;//flour
            recipe[3]=0;//cucumber
            recipe[4]=5;//mutton
            suc=true;
            timeToFinish=10;
        }
        case INDEX_CUCUMBER_BEEF_NOODLE:
        {
            typeIndex=INDEX_CUCUMBER_BEEF_NOODLE;
            typeReward=REWARD_CUCUMBER_BEEF_NOODLE;
            timeRewardPersecond=(int)(REWARD_CUCUMBER_BEEF_NOODLE*0.3);
            capacity=20;
            recipe[0]=5;//beef
            recipe[1]=0;//radish
            recipe[2]=15;//flour
            recipe[3]=5;//cucumber
            recipe[4]=0;//mutton
            suc=true;
            timeToFinish=10;
        }
            break;
            
        default:
            break;
    }
}
-(int)getTypeReward:(int)type{
    suc=true;
    for (int i=0; i<5; i++) {
        if (recipe[i]!=theRealRecipe[i]) {
            suc=false;
        }
    }
    if (suc) {
    }
    else{
        typeReward=0;
    }
    return typeReward;
}
-(int)getTimeReward:(ccTime)time_r{
    timeReward=timeToFinish-time_r;
    return timeReward;
}
@end



/////